Table 54 - MODE SENSE(6) command
=============================================================================== | Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |Byte | | | | | | | | | |=============================================================================| | 0 | Operation code (1Ah) | |-----------------------------------------------------------------------------| | 1 | Logical unit number |Reserved| DBD | Reserved | |-----------------------------------------------------------------------------| | 2 | PC | Page code | |-----------------------------------------------------------------------------| | 3 | Reserved | |-----------------------------------------------------------------------------| | 4 | Allocation length | |-----------------------------------------------------------------------------| | 5 | Control | ===============================================================================A disable block descriptors (DBD) bit of zero indicates that the target may return zero or more block descriptors in the returned MODE SENSE data (see 8.3.3), at the target's discretion. A DBD bit of one specifies that the target shall not return any block descriptors in the returned MODE SENSE data.
The page control (PC) field defines the type of mode parameter values to be returned in the mode pages. The page control field is defined in table 55.
Table 55 - Page control field
============================================ | Code | Type of parameter | Subclause | |------------------------------------------| | 00b | Current values | 8.2.10.1 | | 01b | Changeable values | 8.2.10.2 | | 10b | Default values | 8.2.10.3 | | 11b | Saved values | 8.2.10.4 | ============================================( The page control field only affects the mode parameters within the mode pages, however the PS bit, page code and page length fields should return current values since they have no meaning when used with other types. The mode parameter header and mode parameter block descriptor should return current values. )
The page code specifies which mode page(s) to return. Mode page code usage is defined in table 56.
Table 56 - Mode page code usage for all devices
=============================================================================== | Page code | Description | Subclause | |-----------------------------------------------------------------------------| | 00h | Vendor-specific (does not require page format) | | | 01h - 1Fh | See specific device-types | | | 20h - 3Eh | Vendor-specific (page format required) | | | 3Fh | Return all mode pages | | ===============================================================================An initiator may request any one or all of the supported mode pages from a target. If an initiator issues a MODE SENSE command with a page code value not implemented by the target, the target shall return CHECK CONDITION status and shall set the sense key to ILLEGAL REQUEST and the additional sense code to INVALID FIELD IN CDB.
A page code of 3Fh indicates that all mode pages implemented by the target shall be returned to the initiator. If the mode parameter list exceeds 256 bytes for a MODE SENSE(6) command or 65 536 bytes for a MODE SENSE(10) command, the target shall return CHECK CONDITION status and the sense key shall be set to ILLEGAL REQUEST and the additional sense code set to INVALID FIELD IN CDB.
Mode page 00h, if implemented, shall be returned after all other mode pages.
( Mode pages should be returned in ascending page code order except for mode page 00h. ) ( If the PC field and the page code field are both set to zero the target should return a mode parameter header and block descriptor (if applicable). This provides for compatibility with existing SCSI-1 initiators. )
The mode parameter list for all device types for MODE SELECT and MODE SENSE is defined in 8.3.3. Parts of the mode parameter list are specifically defined for each device type. See subclause three of each peripheral device type for further information.
( An attempt to change a non-changeable mode parameter (via MODE SELECT) results in an error condition (see 8.2.8). ) ( The initiator should issue a MODE SENSE command with the PC field set to 1h and the page code field set to 3Fh to determine which mode pages are supported, which mode parameters within the mode pages are changeable, and the supported length of each mode page prior to issuing any MODE SELECT commands. )
A PC field value of 3h requests that the target return the saved values of the mode parameters. Implementation of saved page parameters is optional. Mode parameters not supported by the target shall be set to zero. If saved values are not implemented, the command shall be terminated with CHECK CONDITION status, the sense key set to ILLEGAL REQUEST and the additional sense code set to SAVING PARAMETERS NOT SUPPORTED.
( The method of saving parameters is vendor-specific. The parameters are preserved in such a manner that they are retained when the target is powered down. All savable pages can be considered saved when a MODE SELECT command issued with the SP bit set to one has returned a GOOD status or after the successful completion of a FORMAT UNIT command. )